package com.jasonzhou.onetomanycontrol.room

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.jasonzhou.onetomanycontrol.room.entity.DeviceRecord

@Dao
interface DeviceRecordDao {
    @Query("select * from  DeviceRecord where address = (:address)")
    suspend fun findRecordByAddress(address: String): DeviceRecord?

    @Query("select * from DeviceRecord")
    suspend fun getAllRecord(): List<DeviceRecord>

    @Query("delete from adjustcolor where id = (:id)")
    suspend fun delColor(id: Long)

    @Insert
    suspend fun insertAll(vararg device: DeviceRecord): List<Long>

    @Update
    suspend fun updateColor(vararg device: DeviceRecord)
}